/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.imenu.ejb;

import com.imenu.entity.ImenuStore;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Yunzi
 */
@Stateless
public class ImenuStoreFacade extends AbstractFacade<ImenuStore> {
    @PersistenceContext(unitName = "iMenuPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public ImenuStoreFacade() {
        super(ImenuStore.class);
    }
    
    public ImenuStore findByTerminalId(String terminalId) {
        return (ImenuStore) getEntityManager().createNamedQuery("ImenuStore.findByTerminalId").setParameter("terminalId", terminalId).getSingleResult();
    }
}
